import * as types from '../constants/ActionTypes';

const initialState = {
  perfenceIsLoading: true,
  perfenceData: {},
};

const PerfenceReducer = (state = initialState, action) => {
  switch (action.type) {
    case types.PERFENCE:
      return ({ ...state,
        ...{
          perfenceIsLoading: false,
          perfenceData: action.perfenceData,
        } });
    case types.PERFENCE_LOADING:
      return ({ ...state,
        ...{
          perfenceIsLoading: action.perfenceIsLoading,
        } });

    default:
      return state;
  }
};

export default PerfenceReducer;
